'use strict';

module.exports = app => {
  const { router, controller } = app;
  const auth = app.middleware.auth(app);
  router.post('/api/signup', controller.user.signup);
  router.post('/api/signin', controller.user.signin);
  router.post('/refresh-token', controller.user.refreshAccessToken);
  router.get('/api/menus', auth, controller.user.menus);
  router.resources('user', '/api/user', auth, controller.user);
  router.resources('role', '/api/role', auth, controller.role);
  router.resources('roleUser', '/api/roleUser', auth, controller.roleUser);
  router.resources(
    'roleResource',
    '/api/roleResource',
    auth,
    controller.roleResource
  );
  router.resources('resource', '/api/resource', auth, controller.resource);
};
